<docs>
  ## 个人简历编辑
</docs>
<template>
  <div>
    <div class="beijingtu"></div>
    <div class="bg_g">
      <!-- 背景图 -->
      <!-- 头部 -->
      <div class="title">
        <label class="person" for="id_avatar" style="display:block">
          <img v-if="!imgShow" class="person" :src="imgSrc" alt />
          <img v-else="imgShow" src="~common/images/tx.png" alt />
        </label>
        <!-- <input type="file" id="id_avatar" name="file" accept="image/*" ref="uploadFile" @change="J_upload()" style="display:none"> -->
        <div class="name" style="color:white">{{jbxx.xm}}</div>
      </div>
      <!-- 每个盒子 -->
      <div class="box1">
        <div class="box_option clearfix" @click="gotoessential">
          <span class="box_option_mc">详细资料</span>
          <span class="unfilled" v-if="this.qqqq==''">未填</span>
          <span class="unfilled" v-else>已填</span>
        </div>
        <div class="box_option" @click="jobintention">
          <span class="box_option_mc">求职意向</span>
          <span class="unfilled" v-if="this.qzyx==null">未填</span>
          <span class="unfilled" v-else>已填</span>
        </div>
        <div class="box_option clearfix" @click="gotoselft">
          <span class="box_option_mc">自我评价</span>
          <span class="unfilled" v-if="this.zwpj==null">未填</span>
          <span class="unfilled" v-else>已填</span>
        </div>
      </div>
      <div class="box1">
        <div class="box_option1 clearfix">
          <span class="box_option_left">学习及工作履历</span>
          <div @click="gotoworkex">
            <span class="box_option_right">添加</span>
            <span style="float:right;margin-right:5px;">
              <img src="../../common/images/add.png" alt />
            </span>
          </div>
        </div>
        <div
          class="describe clearfix"
          v-for="(item,index) in gzjlList"
          :key="index"
          v-bind:id="item.gzllid"
          @click="gotoworkdel"
        >
          <div class="modify"></div>
          <div>时间: {{item.gzkssj}}至{{item.gzjssj}}</div>
          <div>学校(单位): {{item.dwmc}}</div>
          <div>职务: {{item.zw}}</div>
        </div>
      </div>
      <div class="box1">
        <div class="box_option1 clearfix">
          <span class="box_option_left">培训经历</span>
          <div @click="gotoeducation">
            <span class="box_option_right">添加</span>
            <span style="float:right;margin-right:5px;">
              <img src="../../common/images/add.png" alt />
            </span>
          </div>
        </div>

        <div
          class="describe clearfix"
          v-for="(item,index) in pxjlList"
          :key="index"
          v-bind:id="item.pxjlid"
          @click="gotopxjl"
        >
          <div class="modify"></div>
          <div>时间: {{item.pxkssj}}至{{item.pxjssj}}</div>
          <div>学校(单位): {{item.pxxxmc}}</div>
          <div>描述: {{item.pxjn}}</div>
        </div>
      </div>

      <div class="box1">
        <div class="box_option1 clearfix">
          <span class="box_option_left">语言能力</span>
          <div @click="gotolanguage">
            <span class="box_option_right">添加</span>
            <span style="float:right;margin-right:5px;">
              <img src="../../common/images/add.png" alt />
            </span>
          </div>
        </div>
        <div
          class="describe"
          v-for="(item,index) in yynlList"
          :key="index"
          v-bind:id="item.yynlid"
          @click="gotoyynl"
        >
          <div class="modify"></div>
          <div>语种: {{item.yzmc}}</div>
          <div>等级: {{item.djmc}}</div>
        </div>
      </div>
      <div class="box1">
        <div class="box_option clearfix" @click="gototemplate">
          <span class="box_option_mc">简历模板</span>
          <span class="unfilled">已选</span>
        </div>
      </div>
      <!-- 底部保存 -->
      <!-- 底部背景图 -->
    </div>
    <div class="bottom"></div>
  </div>
</template>
<script>
import $ from "@/common/js/axios";

export default {
  data() {
    return {
      imgSrc: "",
      imgSrcName: "",
      imgShow: true,
      jbxx: {},
      // 工作经历
      gzjlList: [],
      // 教育经历
      pxjlList: [],
      // 语言能力
      yynlList: [],
      //自我评价
      zwpj: "",
      // 求职意向
      qzyx: "",
      // 求职意向id
      qzyxid: "",
      // 求职意向判断条件
      qqqq: ""
    };
  },
  computed: {},
  methods: {
    // 跳转到详细信息
    gotoessential() {
      this.$router.push({ path: "/essential" });
    },
    // 跳转到求职意向页面
    jobintention() {
      this.$router.push({ path: "/job?qzyxid=" + this.qzyxid + "" });
      //
    },
    // 跳转到自我评价
    gotoselft() {
      this.$router.push({ path: "/selft" });
    },
    // 跳转到教育经历
    gotoeducation() {
      this.$router.push({ path: "/education" });
    },
    // 跳转到工作经历
    gotoworkex() {
      this.$router.push({ path: "/workex" });
    },
    //跳转到语言能力
    gotolanguage() {
      this.$router.push({ path: "/language" });
    },
    // 跳转到简历模版
    gototemplate() {
      this.$router.push({ path: "/template" });
    },
    // 个人基本信息查询
    getjlxxCx() {
      this.$loading = true;
      $.get("/wdjl/jlxxCx").then(res => {
        var data = res.returnData.jlxx;
        this.jbxx = data.jbxx;
        this.$loading = false;
        this.imgSrcName = data.jbxx.txurl;
        if (this.imgSrcName) {
          this.imgSrc = conf.urlPrefix + "/sysfiles/tx/" + this.imgSrcName;
          this.imgShow = false;
        }
        // 工作经历
        this.gzjlList = data.gzjl;
        // 教育经历
        this.pxjlList = data.pxjl;
        //自我评价
        this.zwpj = data.zwpj;
        // 语言能力
        this.yynlList = data.yynl;
        // 求职意向
        this.qzyx = data.qzyx;
        // 详细信息  学历名称
        this.qqqq = data.jbxx.xlmc;
        // 求职意向id
        if (data.qzyx != null) {
          this.qzyxid = data.qzyx.qzyxid;
        }
      });
    },
    // 跳转到工作经历并删除
    gotoworkdel(e) {
      // 获取到每个属性值的ID
      var id = e.target.offsetParent.id;
      this.$router.push({ path: "/workex?gzllid=" + id + "" });
    },
    // 跳转到教育经历并删除
    gotopxjl(e) {
      var id = e.target.offsetParent.id;
      this.$router.push({ path: "/education?pxjlid=" + id + "" });
    },
    // 跳转到语言能力并删除
    gotoyynl(e) {
      var id = e.target.offsetParent.id;
      this.$router.push({ path: "/language?yynlid=" + id + "" });
    }
  },
  created() {
    this.getjlxxCx();
  },
  mounted() {
    // this.gzjlCx()
  }
};
</script>
<style lang="scss" scoped>
.bg_g {
  padding: 0 34px;
  overflow: hidden;
  position: relative;
}
.box_option_mc {
  color: #333333;
  font-weight: bold;
}
.time {
  float: left;
}
.box_option::after {
  content: " ";
  display: inline-block;
  height: 0.3rem;
  width: 0.3rem;
  border-width: 0.02667rem 0.02667rem 0 0;
  border-color: #555;
  border-style: solid;
  -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  -ms-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
  position: absolute;
  right: 0;
  // margin-top: -0.05333rem;
}
.beijingtu {
  width: 100%;
  height: 880px;
  background: url("../../common/images/beijing.png") no-repeat;
  background-size: 100% 100%;
  position: absolute;
  z-index: -9000;
  margin-top: -230px;
}
.describe {
  // height: .5rem;
  font-size: 28px;
  position: relative;
  // margin:0px 34px;
  padding: 20px 0 20px 10px;
  line-height: 40px;
  background: #ffffff;
  border: 1px solid #ededed;
  box-shadow: 0px 0px 7px #e0dcdc;
  border-radius: 4px;
  color: #333333;
  margin: 10px 34px 22px 34px;
  .modify {
    width: 35px;
    height: 35px;
    background: url("../../common/images/xiugai.png") no-repeat;
    background-size: 100%;
    position: absolute;
    right: 5%;

    top: 50px;
  }
  div {
    overflow: hidden;
    width: 97%;

    display: inline-block;
    text-overflow: ellipsis; //溢出用省略号显示
    white-space: nowrap; //溢出不换行
  }
  .xg {
    width: 32px;
    height: 32px;
    background: url("../../common/images/xg.png");
    position: absolute;
  }
}
.de {
  position: relative;
  margin: 50px 34px;
  // height:100px;
  // background:gainsboro;
}
.bottom {
  width: 100%;
  height: 190px;
  background: url("../../common/images/dbg.png") no-repeat;
  background-size: 100%;
  z-index: -999;
  // position: absolute;
  position: fixed;
  bottom: 0;
}
.title {
  margin-top: 66px;
  .person {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin: auto;
    margin-bottom: 34px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .name {
    display: flex;
    justify-content: center;
    font-size: 32px;
    height:32px;
    font-weight: bold;
    margin-bottom: 66px;
  }
}
.box1 {
  // width: 85%;
  // padding: 0 34px;
  margin: 20px auto;
  background: white;
  overflow: hidden;
  border-radius: 4px;
  line-height: 24px;
  .unfilled {
    color: #666666;
    float: right;
    margin-right: 40px;
  }
  // 上右下左
  .box_option1 {
    margin: 42px 34px 25px 34px;
    font-weight: bold;
  }
  .box_option1 img {
    width: 36px;
    height: 36px;
    margin-top: -9px;
  }
  .box_option {
    line-height: 30px;
    margin: 56px 34px 34px 34px;
    position: relative;
  }
  .box_option_left {
    float: left;
    color: #1c57db;
  }
  .box_option_right {
    float: right;
    color: #1c57db;
  }
}
</style>
